# -*- coding: UTF-8 -*-
# Author: Damon(wuud1)
# CreateDate: 
# Message:


# s = '''Host: csapi.saic-gm.com
# Connection: keep-alive
# Pragma: no-cache
# Cache-Control: no-cache
# User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36
# Accept: image/webp,image/apng,image/*,*/*;q=0.8
# Referer: https://dpj.saic-gm.com/epcoloe4dealer/src/index.html?r=9.105398979652339
# Accept-Encoding: gzip, deflate, br
# Accept-Language: zh-CN,zh;q=0.9'''
#
# s_l = s.split("\n")
# for i in s_l:
#     k = i.split(": ")[0]
#     v = i.split(": ")[1]
#     print('"{}": "{}",'.format(k, v))

from cadillac_getCookies import ToolBox

# from setting import Account
# user = Account.get("username")
# pswd = Account.get("password")
# tools = ToolBox()
# s, d, u = tools.run(user, pswd)
# print(s)
# print(d)
# print(u)


s = '''[{
	"catalogCode": "CJ1",
	"catalogName": "CJ1:全新一代凯越",
	"catalogEn": "EXCELLE",
	"groups": null
}, {
	"catalogCode": "CP2",
	"catalogName": "CP2:英朗",
	"catalogEn": "Excelle XT/GT",
	"groups": null
}, {
	"catalogCode": "CP4",
	"catalogName": "CP4:昂科威",
	"catalogEn": "ENVISION",
	"groups": null
}, {
	"catalogCode": "CP5",
	"catalogName": "CP5:威朗",
	"catalogEn": "Verano",
	"groups": null
}, {
	"catalogCode": "CP6",
	"catalogName": "CP6:威朗轿跑/GS",
	"catalogEn": "Verano HB/GS",
	"groups": null
}, {
	"catalogCode": "CR1",
	"catalogName": "CR1:昂科雷",
	"catalogEn": "ENCLAVE",
	"groups": null
}, {
	"catalogCode": "CS1",
	"catalogName": "CS1:赛欧",
	"catalogEn": "SAIL",
	"groups": null
}, {
	"catalogCode": "CU1",
	"catalogName": "CU1:GL8",
	"catalogEn": "GL8",
	"groups": null
}, {
	"catalogCode": "CU2",
	"catalogName": "CU2:陆尊",
	"catalogEn": "Firstland",
	"groups": null
}, {
	"catalogCode": "CU3",
	"catalogName": "CU3:GL8 S",
	"catalogEn": "GL8 S",
	"groups": null
}, {
	"catalogCode": "CU4",
	"catalogName": "CU4:GL8 ES 豪华商旅车",
	"catalogEn": "GL8 ES",
	"groups": null
}, {
	"catalogCode": "CW1",
	"catalogName": "CW1:君威",
	"catalogEn": "REGAL",
	"groups": null
}, {
	"catalogCode": "CW2",
	"catalogName": "CW2:君越",
	"catalogEn": "LaCROSSE",
	"groups": null
}, {
	"catalogCode": "CW3",
	"catalogName": "CW3:君越（混合动力）",
	"catalogEn": "LaCrosse(hybrid)",
	"groups": null
}, {
	"catalogCode": "EG1",
	"catalogName": "EG1:新君威",
	"catalogEn": "New REGAL",
	"groups": null
}, {
	"catalogCode": "EG2",
	"catalogName": "EG2:新君越",
	"catalogEn": "New LaCROSSE",
	"groups": null
}, {
	"catalogCode": "EG6",
	"catalogName": "EG6:全新一代君越",
	"catalogEn": "All-New LaCrosse",
	"groups": null
}, {
	"catalogCode": "EG7",
	"catalogName": "EG7:全新一代君威",
	"catalogEn": "Regal",
	"groups": null
}, {
	"catalogCode": "S8E",
	"catalogName": "S8E:林荫大道",
	"catalogEn": "Park Avenue",
	"groups": null
}, {
	"catalogCode": "S8W",
	"catalogName": "S8W:荣御",
	"catalogEn": "ROYAUM",
	"groups": null
}, {
	"catalogCode": "SJ2",
	"catalogName": "SJ2:昂科拉",
	"catalogEn": "ENCORE",
	"groups": null
}, {
	"catalogCode": "SK1",
	"catalogName": "SK1:全新英朗",
	"catalogEn": "Excelle GT",
	"groups": null
}, {
	"catalogCode": "SK3",
	"catalogName": "SK3:阅朗",
	"catalogEn": "Excelle GX",
	"groups": null
}, {
	"catalogCode": "SK4",
	"catalogName": "SK4:GL6",
	"catalogEn": "GL6",
	"groups": null
}, {
	"catalogCode": "SR1",
	"catalogName": "SR1:VELITE 5",
	"catalogEn": "VELITE 5",
	"groups": null
}, {
	"catalogCode": "SV1",
	"catalogName": "SV1:全新一代凯越",
	"catalogEn": "EXCELLE",
	"groups": null
}]'''

s = '''[{"catalogCode":"C11","catalogName":"C11:凯迪拉克 ESCALADE","catalogEn":"CADILLAC ESCALADE","groups":null},{"catalogCode":"CA1","catalogName":"CA1:凯迪拉克 ATS","catalogEn":"CADILLAC ATS","groups":null},{"catalogCode":"CA2","catalogName":"CA2:凯迪拉克 New CTS","catalogEn":"CADILLAC New CTS","groups":null},{"catalogCode":"CD3","catalogName":"CD3:凯迪拉克 CTS","catalogEn":"CADILLAC CTS","groups":null},{"catalogCode":"CD4","catalogName":"CD4:凯迪拉克 CTS Coupe","catalogEn":"CADILLAC CTS Coupe","groups":null},{"catalogCode":"CE2","catalogName":"CE2:凯迪拉克 SRX","catalogEn":"CADILLAC SRX","groups":null},{"catalogCode":"CK1","catalogName":"CK1:凯迪拉克 CT6","catalogEn":"CADILLAC CT6","groups":null},{"catalogCode":"CN1","catalogName":"CN1:凯迪拉克 New SRX","catalogEn":"CADILLAC New SRX","groups":null},{"catalogCode":"CY1","catalogName":"CY1:凯迪拉克 XLR","catalogEn":"CADILLAC XLR","groups":null},{"catalogCode":"EG4","catalogName":"EG4:凯迪拉克 XTS","catalogEn":"CADILLAC XTS","groups":null},{"catalogCode":"EG8","catalogName":"EG8:凯迪拉克 XT4","catalogEn":"XT4","groups":null},{"catalogCode":"S6D","catalogName":"S6D:凯迪拉克 赛威","catalogEn":"CADILLAC SLS","groups":null},{"catalogCode":"SA1","catalogName":"SA1:凯迪拉克 ATSL","catalogEn":"CADILLAC ATSL","groups":null},{"catalogCode":"SN1","catalogName":"SN1:凯迪拉克 XT5","catalogEn":"CADILLAC XT5","groups":null}]'''

# import json
#
# for i in json.loads(s):
#     cid = i.get("catalogCode")
#     name = i.get("catalogName").split(":")[1]
#     print(cid, name)


s = 'https://dpj.saic-gm.com/epcoloe4dealer/src/index.html?r=2.748796655743524#/app/catalogs'



